<include file="public:header" />
<!--添加/删除帖子-->
<form id="info_form" action="{:U('thread/oppt')}" method="post" enctype="multipart/form-data">
<input type="hidden" name="type" value="{$type}" />
<if condition="$type eq 'edit'">
<input type="hidden" name="id" value="{$info.id}" />
</if>
<div class="pad_lr_10">
	<div class="col_tab">
		<ul class="J_tabs tab_but cu_li">
			<li class="current">{:L("thread_$type")}</li>			
		</ul>
		<div class="J_panes">
			<div class="content_list pad_10">
				<table width="100%" cellspacing="0" class="table_form">
				
		            <tr>
						<th>{:L('thread_title')} :</th>
						<td>
							<input type="text" name="title" id="J_title" class="input-text" value="{$info.title}" style="color: {$info.color};" size="30">
					        <input type="hidden" value="" name="color" id="J_color">
					        <a href="javascript:;" class="color_picker_btn"><img class="J_color_picker" data-it="J_title" data-ic="J_color" src="__STATIC__/images/color.png"></a>
		                </td>
					</tr>
                    
		            <tr>
						<th>{:L('sort_order')} :</th>
						<td>
							<input type="text" name="ordid" value="{$info.ordid}"  id="J_ordid" class="input-text" size="30">					     
		                </td>
					</tr>     		                                                                
					<tr>
						<th>{:L('publish')} :</th>
		 				<td>
		                	<label><input  type="radio" <if condition="$info.status eq 1 ">checked=""</if> name="status" class="radio_style" value="1"> {:L('yes')} </label>&nbsp;&nbsp;
							<label><input type="radio" name="status" <if condition="$info.status eq 0 ">checked=""</if> class="radio_style" value="0"> {:L('no')}</label>
						</td>
					</tr>
                    
              	    <tr>
            			<th>附件 :</th>
            			<td>
                             <div style="float: left;" id="attachment_list">
                                <input type="file" name="attachment[]" />
                             </div>
            		         <div style="float: left;">
                                <a id="add_attachment" href="javascript:void(0);">增加附件</a>
                             </div>
            			</td>
            		</tr>
                                       
		            <tr>
						<th>详细内容 :</th>
		                <td><textarea name="content" id="content" style="width:68%;height:400px;visibility:hidden;resize:none;">{$info.content}</textarea></td>
					</tr>
				</table>
			</div>
			
        </div>
		<div class="mt10"><input type="submit" value="{:L('submit')}" id="dosubmit" name="dosubmit" class="btn btn_submit" style="margin:0 0 10px 100px;"><br /><br /><br /></div>
	</div>
</div>
</form>
<include file="public:footer" />
<script src="__STATIC__/js/jquery/plugins/colorpicker.js"></script>
<script src="__STATIC__/js/kindeditor/kindeditor.js"></script>
<script>
$('.J_cate_select').cate_select('请选择');
$(function() {
	KindEditor.create('#content', {
		uploadJson : '{:U("attachment/editer_upload")}',
		fileManagerJson : '{:U("attachment/editer_manager")}',
		allowFileManager : true
	});
    
	$('ul.J_tabs').tabs('div.J_panes > div');

	//颜色选择器
	$('.J_color_picker').colorpicker();

	//自动获取标签
	$('#J_gettags').live('click', function() {
		var title = $.trim($('#J_title').val());
		if(title == ''){
			$.pinphp.tip({content:lang.thread_title_isempty, icon:'alert'});
			return false;
		}
		$.getJSON('{:U("thread/ajax_gettags")}', {title:title}, function(result){
			if(result.status == 1){
				$('#J_tags').val(result.data);
			}else{
				$.pinphp.tip({content:result.msg});
			}
		});
	});
	
});

//多图片上传
$("#add_attachment").click(function(){
   $("#attachment_list").append('<br/><input type="file" name="attachment[]" />'); 
});
</script>
</body>
</html>